package common.splitpage;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Condition implements Serializable{
	public final static int PAGE_SIZE = 10;
	
	private boolean isPage=false;
	
	private int rowCount;
	private int pageRowCount; 
	private int pageSize=PAGE_SIZE;
	
	private int startRow = 0;
	private int endRow = 0;

	private int curPage=1;
	
	private boolean isFirst;
	private boolean isLast;
	private boolean isNext;
	private boolean isPrevious;
	
	private boolean isHasNext = false;
	private boolean isHasPrevious = false;
	
	private int pageCount=0;
	
	private String sql;
	
	private StringBuffer sb = new StringBuffer();
	
	public void and(String sql){
		sb.append(" "+sql+" ");
	}
	
	
	public void clear(){
		sb = null;
	}
	
	public String getWhere(){
		if(sb==null || sb.length()==0){
			return "";
		}
		else
			return sb.toString();
	}
	
	private String getValue(String type,String value){
		if("int".equals(type)){
			return value;
		}
		else{
			return "'"+value+"'";
		}
	}
	
	public static void main(String[] args){

	}

	public int getCurPage() {
		return curPage;
	}

	public void setCurPage(int curPage) {
		this.curPage = curPage;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public boolean isPage() {
		return isPage;
	}

	public void setPage(boolean isPage) {
		this.isPage = isPage;
	}

	public boolean isFirst() {
		return isFirst;
	}

	public void setFirst(boolean isFirst) {
		this.isFirst = isFirst;
	}

	public boolean isLast() {
		return isLast;
	}

	public void setLast(boolean isLast) {
		this.isLast = isLast;
	}

	public boolean isNext() {
		return isNext;
	}

	public void setNext(boolean isNext) {
		this.isNext = isNext;
	}

	public boolean isPrevious() {
		return isPrevious;
	}

	public void setPrevious(boolean isPrevious) {
		this.isPrevious = isPrevious;
	}

	public int getPageRowCount() {
		return pageRowCount;
	}

	public void setPageRowCount(int pageRowCount) {
		this.pageRowCount = pageRowCount;
	}

	public int getRowCount() {
		return rowCount;
	}

	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
	}

	public String getSql() {
		return sql;
	}

	public void setSql(String sql) {
		this.sql = sql;
	}

	public int getStartRow() {
		return startRow;
	}

	public void setStartRow(int startRow) {
		this.startRow = startRow;
	}

	public int getEndRow() {
		return endRow;
	}

	public void setEndRow(int endRow) {
		this.endRow = endRow;
	}

	public boolean isHasNext() {
		return isHasNext;
	}

	public void setHasNext(boolean isHasNext) {
		this.isHasNext = isHasNext;
	}

	public boolean isHasPrevious() {
		return isHasPrevious;
	}

	public void setHasPrevious(boolean isHasPrevious) {
		this.isHasPrevious = isHasPrevious;
	}
	
}
